extends HBoxContainer

@onready var heartNode=$红心

func setMaxHealth(num:int):
	for i in range(num-1):
		var heart=heartNode.duplicate()
		add_child(heart)

func updateHealth(num:int):
	var hearts=get_children()
	for i in range(num):
		hearts[i].update(true)

	for i in range(num,hearts.size()):
		hearts[i].update(false)
